﻿using System;
using System.Collections.Generic;

using System.Text;
using Models;
using DAL;

namespace BLL
{
    public class LoginManager
    {
        LoginService ls = new LoginService();
        //登陆密码加密
        public bool encode(string id, string pwd)
        {
            pwd = Convert.ToBase64String(new System.Security.Cryptography.SHA1CryptoServiceProvider().ComputeHash(Encoding.ASCII.GetBytes(pwd)));
            if (ls.isLogin(id, pwd))
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public bool isVer()
        {
            if (ls.isLogin(1) && ls.isLogin(2))
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
